//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	IConfiguration.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

using System;
using Microsoft.SharePoint;

namespace Smart.Common
{
	public interface IConfiguration
	{
		/// <summary>
		/// Detects current site
		/// </summary>
		SPSite CurrentSite { get; }

		/// <summary>
		/// Detects current web
		/// </summary>
		SPWeb CurrentWeb { get; }

		/// <summary>
		/// Detects current user
		/// </summary>
		SPUser CurrentUser { get; }

		/// <summary>
		/// Detects current list
		/// </summary>
		SPList CurrentList { get; }

		/// <summary>
		/// Get Configuration value
		/// </summary>
		/// <param name="key">Configuration key title</param>
		/// <param name="defaultValue">Default configuration value</param>
		/// <returns>Configuration value or defaultValue</returns>
		string GetValue(string key, string defaultValue);

		/// <summary>
		/// Get Configuration Value
		/// </summary>
		/// <param name="site">Current site</param>
		/// <param name="web">Current web</param>
		/// <param name="list">Current list (can be Null)</param>
		/// <param name="user">Current user (can be Null)</param>
		/// <param name="key">Configuration key title</param>
		/// <param name="defaultValue">Default return value</param>
		/// <returns>Configuration value or defaultValue</returns>
		string GetValue(SPSite site, SPWeb web, SPList list, SPUser user, string key, string defaultValue);

		/// <summary>
		/// Set configuration value for user
		/// </summary>
		/// <param name="user">User for which the configuration</param>
		/// <param name="key">Title of configuration</param>
		/// <param name="value">Value of configuration</param>
		void SetValue(SPUser user, string key, string value);

		/// <summary>
		/// Remove configuration value for user
		/// </summary>
		void RemoveValue(SPUser user, string key);

		/// <summary>
		/// Set configuration value for list
		/// </summary>
		/// <param name="list">List for which the configuration</param>
		/// <param name="key">Title of configuration</param>
		/// <param name="value">Value of configuration</param>
		void SetValue(SPList list, string key, string value);

		/// <summary>
		/// Remove configuration value for list
		/// </summary>
		void RemoveValue(SPList list, string key);

		/// <summary>
		/// Set configuration value for web
		/// </summary>
		/// <param name="web">Web for which the configuration</param>
		/// <param name="key">Title of configuration</param>
		/// <param name="value">Value of configuration</param>
		void SetValue(SPWeb web, string key, string value);

		/// <summary>
		/// Remove configuration value for web
		/// </summary>
		void RemoveValue(SPWeb web, string key);

		/// <summary>
		/// Set configuration value for current user
		/// </summary>
		/// <param name="key">Title of configuration</param>
		/// <param name="value">Value of configuration</param>
		void SetUserValue(string key, string value);

		/// <summary>
		/// Remove configuration value for current user
		/// </summary>
		void RemoveUserValue(string key);

		/// <summary>
		/// Set configuration value for list by list guid
		/// </summary>
		/// <param name="listGuid">List guid for which the configuration</param>
		/// <param name="key">Title of configuration</param>
		/// <param name="value">Value of configuration</param>
		void SetListValue(Guid listGuid, string key, string value);

		/// <summary>
		/// Remove configuration value for list
		/// </summary>
		void RemoveListValue(Guid listGuid, string key);

		/// <summary>
		/// Set configuration value for web by web guid
		/// </summary>
		/// <param name="webGuid">Web guid for which the configuration</param>
		/// <param name="key">Title of configuration</param>
		/// <param name="value">Value of configuration</param>
		void SetWebValue(Guid webGuid, string key, string value);

		/// <summary>
		/// Remove configuration value for web by web guid
		/// </summary>
		void RemoveWebValue(Guid webGuid, string key);
	}
}